home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
COMAL
/
cboot.d64
/
convert(plus).l
< prev
next >
Wrap
Text File
|
2009-01-23
|
6KB
|
152 lines
9000 // LIST 9000-9750,"@0:BIT'MAP'PRINT.L"
9005 // ╘.┬.╚.╦UIPER 1984
9010 // DUMPS THE HIGH RESOLUTION BIT MAP TO THE LINE PRINTER;
9015 // LABELS ARE ADDED TO THE AXES WHEN PRINTED;
9020 // CONFIGURED FOR A ╟EMINI 10 PRINTER WITH A ├ARDCO INTERFACE
9025 //
9030 // EXAMPLE OF USE:
9035 // DIM XLABEL$ OF 40, YLABEL$ OF 30
9040 // READ'HIDDEN'RAM'SETUP
9045 // *** YOUR CODE HERE ***
9050 // XLABEL$:="LOG(2,2/1,1 ╥ATIO)"
9055 // YLABEL$:="╦INETIC ╘EMPERATURE (╦)"
9060 // BIT'MAP'PRINT(XLABEL$,YLABEL$)
9065 // END
9070 //
9075 PROC BIT'MAP'PRINT(REF XLABEL$,REF YLABEL$) CLOSED
9080 BIT'MAP:=57344
9085 LC'CHAR'ROM:=55296
9090 NUM'DOTS:=500 // NUMBER OF DOTS PER LINE FROM LEFT MARGIN
9095 NUM'DOTS'HI:=INT(NUM'DOTS/256)
9100 NUM'DOTS'LO:=NUM'DOTS-256*NUM'DOTS'HI
9105 DIM OUT$ OF NUM'DOTS
9110 OUT$(1:40):=""
9115 XLABEL$(1:40):=OUT$(1:20-INT(LEN(XLABEL$)/2))+XLABEL$
9120 YLABEL$(1:30):=OUT$(1:15-INT(LEN(YLABEL$)/2))+YLABEL$
9125 // PRINT THE Y-AXIS LABEL:
9130 OPEN FILE 255,"",UNIT 4,7,READ // CARDCO I/F IN UPPER/LOWER CASE MODE
9135 PRINT FILE 255: CHR$(12)+CHR$(27)+"┬"+CHR$(1), // FORMFEED; PITCH 12 CPI
9140 SKIP'LINES(20) // CENTER PLOT ON PAGE
9145 // PRINT Y-AXIS LABEL IN DOUBLE-STRIKE, EMPHASIZED MODE
9150 PRINT FILE 255: CHR$(27)+"╟"+CHR$(9)+CHR$(27)+"┼"+YLABEL$,
9155 PRINT FILE 255: CHR$(27)+"╚"+CHR$(27)+"╞"+CHR$(10)
9160 CLOSE FILE 255
9165 // SET UP PRINTER FOR GRAPHICS:
9170 OPEN FILE 255,"",UNIT 4,5,READ // CARDCO I/F IN BIT MAP MODE
9175 PRINT FILE 255: CHR$(27)+CHR$(64), // RESET PRINTER
9180 PRINT FILE 255: CHR$(27)+CHR$(49), // LINE FEED TO 7/72 INCH
9185 FOR COLUMN:=0 TO 39 DO
9190 OUT$:="" // CLEAR PREVIOUS LINE FROM OUTPUT STRING
9195 FOR I:=1 TO NUM'DOTS-418 DO // PUT IN LEADING BLANKS...
9200 OUT$:=OUT$+CHR$(0) // ...TO MOVE THE BIT-MAP...
9205 ENDFOR I // ...IMAGE OFF THE PAPER MARGIN
9210 CHAR'ADDR:=LC'CHAR'ROM+8*SCREEN'CODE(XLABEL$(COLUMN+1))
9215 GET'BYTES(CHAR'ADDR,OUT$) // PRINT THE APPROPRIATE X-LABEL CHARACTER
9220 OUT$:=OUT$+CHR$(0)+CHR$(0) // SOME SPACE BETWEEN LABEL AND X-AXIS
9225 PRINT FILE 255: CHR$(27)+"L"+CHR$(NUM'DOTS'LO)+CHR$(NUM'DOTS'HI),
9230 FOR ROW:=24 TO 0 STEP -1 DO // PUT ALL THE 'CHARACTERS' FROM THE ...
9235 CHAR'ADDR:=BIT'MAP+8*(COLUMN+40*ROW) // ...CURRENT COLUMN INTO THE ...
9240 GET'BYTES(CHAR'ADDR,OUT$) // ... OUTPUT STRING
9245 ENDFOR ROW
9250 PRINT FILE 255: OUT$ // PRINT THE COLUMN
9255 ENDFOR COLUMN
9260 OUT$:=""
9265 PRINT FILE 255: OUT$
9270 PRINT FILE 255: CHR$(27)+CHR$(64) // RESET PRINTER
9275 SKIP'LINES(20) // MOVE TO NEXT PAGE
9280 PRINT FILE 255: CHR$(27)+CHR$(64) // RESET PRINTER
9285 CLOSE FILE 255
9290 ENDPROC BIT'MAP'PRINT
9295 //
9300 PROC SKIP'LINES(N) CLOSED
9305 FOR I:=1 TO N DO
9310 PRINT FILE 255: CHR$(10),
9315 ENDFOR I
9320 ENDPROC SKIP'LINES
9325 //
9330 PROC READ'HIDDEN'RAM'SETUP
9335 // TO READ HIDDEN RAM:
9340 // SET UP MACHINE CODE BY CALLING THIS PROCEDURE,
9345 // POKE ADDRESS TO READ INTO 842 (LOW BYTE) AND 843 (HIGH BYTE),
9350 // SYS 829, AND
9355 // PEEK CONTENTS FROM 855.
9360 //
9365 // 828 TEMPORARY STORAGE FOR MEMORY CONTROL REGISTER
9370 POKE 829,173 // LDA... (SAVE...
9375 POKE 830,1 // ...1 + (...THE...
9380 POKE 831,0 // ...0*256 (=1) (...MEMORY...
9385 POKE 832,141 // STA... (...CONTROL...
9390 POKE 833,60 // ...60 + (...SETTING
9395 POKE 834,3 // ...3*256 (=828)
9400 POKE 835,120 // SEI (DISABLE INTERRUPTS
9405 POKE 836,73 // EOR... (REVERSE...
9410 POKE 837,7 // ...$7 (...THE...
9415 POKE 838,141 // STA... (...MEMORY...
9420 POKE 839,1 // ... (...CONTROL...
9425 POKE 840,0 // ...(=1) (...SETTING
9430 POKE 841,173 // LDA...
9435 // 842 ...LOW BYTE OF ADDRESS TO READ
9440 // 843 ...HIGH BYTE OF ADDRESS TO READ
9445 POKE 844,141 // STA... (FETCH...
9450 POKE 845,87 // ...87 + (...DESIGNATED...
9455 POKE 846,3 // ...3*256 (=855) (..BYTE
9460 POKE 847,173 // LDA... (RESTORE...
9465 POKE 848,60 // ... (...THE...
9470 POKE 849,3 // ...(=828) (...MEMORY...
9475 POKE 850,141 // STA... (...CONTROL...
9480 POKE 851,1 // ... (...SETTING
9485 POKE 852,0 // ...(=1)
9490 POKE 853,88 // CLI (ENABLE INTERRUPTS
9495 POKE 854,96 // RTS
9500 // 855 CONTAINS RETRIEVED BYTE
9505 ENDPROC READ'HIDDEN'RAM'SETUP
9510 //
9515 PROC GET'BYTES(CHAR'ADDR,REF OUT$) CLOSED
9520 // GET THE EIGHT BYTES OF A 'CHARACTER' FROM CHARACTER ROM OR BIT MAP ...
9525 // ... AND APPEND TO 'OUT$'.
9530 FOR BYTE:=7 TO 0 STEP -1 DO
9535 BYTE'ADDR:=BYTE+CHAR'ADDR
9540 HIGH'BYTE#:=INT(BYTE'ADDR/256)
9545 LOW'BYTE#:=BYTE'ADDR-256*HIGH'BYTE#
9550 POKE 842,LOW'BYTE#
9555 POKE 843,HIGH'BYTE#
9560 SYS 829
9565 OUT$:=OUT$+CHR$(PEEK(855))+CHR$(PEEK(855))
9570 ENDFOR BYTE
9575 ENDPROC GET'BYTES
9580 //
9585 FUNC SCREEN'CODE(ASCII$) CLOSED // RETURN SCREEN CODE VALUE OF CHARACTER
9590 AS:=ORD(ASCII$)
9595 RETURN LAND(AS,128)/2+LAND(AS,63)
9600 ENDFUNC SCREEN'CODE
9605 //
9610 FUNC LOGICAL'SET'UP(NUM,MASK,OP) CLOSED
9615 //
9620 // SET UP MACHINE CODE TO RESIDE
9625 // BETWEEN THE SCREEN AND THE
9630 // SPRITE POINTERS.
9635 //
9640 POKE 2024,169
9645 POKE 2025,NUM
9650 POKE 2026,OP
9655 POKE 2027,MASK
9660 POKE 2028,141
9665 POKE 2029,240
9670 POKE 2030,7
9675 POKE 2031,96
9680 SYS 2024
9685 RETURN PEEK(2032)
9690 ENDFUNC LOGICAL'SET'UP
9695 //
9700 FUNC LAND(NUM,MASK) CLOSED
9705 RETURN LOGICAL'SET'UP(NUM,MASK,41)
9710 ENDFUNC LAND
9715 //
9720 FUNC LOR(NUM,MASK) CLOSED
9725 RETURN LOGICAL'SET'UP(NUM,MASK,9)
9730 ENDFUNC LOR
9735 //
9740 FUNC XOR(NUM,MASK) CLOSED
9745 RETURN LOGICAL'SET'UP(NUM,MASK,73)
9750 ENDFUNC XOR